package cn.gong.jizhang.datacenter.data;

import cn.gong.jizhang.datacenter.async.AsyncData;
import cn.gong.jizhang.datacenter.async.AsyncData.DBCallBack;
import cn.gong.jizhang.datacenter.async.AsyncData.DBDeal;
import cn.gong.jizhang.datacenter.db.RecordDb;
import cn.gong.jizhang.enumparams.DbTaskType;

public class RecordData {

	public void addRecord(final int money, final String mark, DBCallBack callBack) {
		AsyncData.getInstance().deal(DbTaskType.DB_TS_ADD_RECORD, callBack, new DBDeal() {

			@Override
			public Object deal() {
				new RecordDb().addRecord(money, mark);
				return true;
			}
		});
	}

	public void getRecodList(final int page,DBCallBack callBack) {
		AsyncData.getInstance().deal(DbTaskType.DB_TS_GET_RECORD_LIST, callBack, new DBDeal() {

			@Override
			public Object deal() {
				return new RecordDb().getRecordList(page);
			}
		});
	}

}
